package Java.com;

public class ExampleOverloading {
	public static void main(String[] args) {
		int a = 11;
		int b = 6;
		double c = 7.3;
		double d = 9.4;
		int result1 = getMin(a, b);

		/**
		 * 具有相同函数名称，但数字不同参数
		 */
		double result2 = getMin(c, d);
		System.out.println("Minnum Value= " + result1);
		System.out.println("Minnum Value= " + result2);
	}

	/**
	 * 如果int类型的数值(方法重载)
	 */
	public static int getMin(int n1, int n2) {
		int min;
		if (n1 > n2)
			min = n2;
		else
			min = n1;
		return min;
	}

	/**
	 * 处理double类型的数值(方法重载)
	 */
	public static double getMin(double n1, double n2) {
		double min;
		if (n1 > n2)
			min = n2;
		else
			min = n1;
		return min;
	}
}
